#define _CRT_SECURE_NO_WARNINGS 1
int* productExceptSelf(int* nums, int numsSize, int* returnSize) {
    *returnSize = numsSize;
    static int R[100000];
    //  for(int k=0;k<numsSize;k++)
  //R[k]=1;
    R[0] = 1;
    int L = 1;
    for (int i = 1; i < numsSize; i++)
    {
        R[i] = R[i - 1] * nums[i - 1];
    }

    for (int j = numsSize - 1; j >= 0; j--)
    {
        R[j] *= L;
        L *= nums[j];
    }
    return R;
}